package com.dick.base.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dick.base.model.BaseRole;
import com.dick.base.model.BaseUserRole;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface BaseUserRoleMapper extends BaseMapper<BaseUserRole> {
    @Select("SELECT distinct bur.USER_ID FROM base_user_role bur WHERE bur.ROLE_ID IN (select id from base_role br where br.ROLE_CODE = #{roleCode}) ")
    List<Long> findUserIdByRoleId(@Param("roleCode") String roleCode);
}
